package com.park.common.poo;

import javax.persistence.*;
import java.math.BigDecimal;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Created by Administrator on 2017-05-01.
 */
@Entity
@Table(name = "order_info", schema = "", catalog = "totem")
public class OrderInfo {
    private int orderId;
    private String orderNo;
    private int id;
    private int expressId;
    private BigDecimal orderSumPrice;
    private String payStatus;
    private String orderStatus;
    private String createTime;
    private String updateTime;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "orderId")
    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "expressId")
    public int getExpressId() {
        return expressId;
    }

    public void setExpressId(int expressId) {
        this.expressId = expressId;
    }

    @Basic
    @Column(name = "orderSumPrice")
    public BigDecimal getOrderSumPrice() {
        return orderSumPrice;
    }

    public void setOrderSumPrice(BigDecimal orderSumPrice) {
        this.orderSumPrice = orderSumPrice;
    }

    @Basic
    @Column(name = "payStatus")
    public String getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(String payStatus) {
        this.payStatus = payStatus;
    }

    @Basic
    @Column(name = "orderStatus")
    public String getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    @Basic
    @Column(name = "createTime")
    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "updateTime")
    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OrderInfo orderInfo = (OrderInfo) o;

        if (orderId != orderInfo.orderId) return false;
        if (id != orderInfo.id) return false;
        if (expressId != orderInfo.expressId) return false;
        if (orderSumPrice != null ? !orderSumPrice.equals(orderInfo.orderSumPrice) : orderInfo.orderSumPrice != null)
            return false;
        if (payStatus != null ? !payStatus.equals(orderInfo.payStatus) : orderInfo.payStatus != null) return false;
        if (createTime != null ? !createTime.equals(orderInfo.createTime) : orderInfo.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(orderInfo.updateTime) : orderInfo.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = orderId;
        result = 31 * result + id;
        result = 31 * result + expressId;
        result = 31 * result + (orderSumPrice != null ? orderSumPrice.hashCode() : 0);
        result = 31 * result + (payStatus != null ? payStatus.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        return result;
    }
}
